package com.mengdie.shuidi.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.mengdie.shuidi.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by apple on 16/10/14.
 */

public class DisposeActivity extends BaseActivity {

    @Bind(R.id.rl_generic_back)
    RelativeLayout mRlGenericBack;
    @Bind(R.id.tv_generic_title)
    TextView mTvGenericTitle;
    @Bind(R.id.rl_dispose_yes)
    RelativeLayout mRlDisposeYes;
    @Bind(R.id.iv_dispose_yes)
    ImageView mIvDisposeYes;
    @Bind(R.id.rl_dispose_no)
    RelativeLayout mRlDisposeNo;
    @Bind(R.id.iv_dispose_no)
    ImageView mIvDisposeNo;
    @Bind(R.id.tv_dispose_break)
    TextView mTvDisposeBreak;
    @Bind(R.id.tv_dispose_break_second)
    TextView mTvDisposeBreakSecond;
    @Bind(R.id.tv_dispose_reconnect)
    TextView mTvDisposeReconnect;
    @Bind(R.id.tv_dispose_reconnect_second)
    TextView mTvDisposeReconnectSecond;
    @Bind(R.id.tv_dispose_save)
    TextView mTvDisposeSave;

    private String isOpne = "yes";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dispose);
        ButterKnife.bind(this);
        init();
    }

    public void init() {
        mTvGenericTitle.setText("软件配置");
        mIvDisposeYes.setVisibility(View.VISIBLE);
    }

    @OnClick({R.id.rl_generic_back, R.id.rl_dispose_yes, R.id.rl_dispose_no, R.id.tv_dispose_save})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rl_generic_back:
                onBackPressed();
                break;
            case R.id.rl_dispose_yes:
                if (isOpne.equals("no")) {
                    isOpne = "yes";
                    mIvDisposeYes.setVisibility(View.VISIBLE);
                    mIvDisposeNo.setVisibility(View.GONE);
                }
                break;
            case R.id.rl_dispose_no:
                if (isOpne.equals("yes")) {
                    isOpne = "no";
                    mIvDisposeYes.setVisibility(View.GONE);
                    mIvDisposeNo.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.tv_dispose_save:
                finish();
                break;
        }
    }
}
